

import React from 'react';
import { MsgBase } from './Base';
import { IMessageItem } from './type';
import { MSG_TYPE } from '@/pages/home/config';
export function MessageFail(props: { message: IMessageItem;onReStart:()=>void }) { 
    const { message,onReStart }=props
    const isError = message.type === MSG_TYPE.ERROR
    const isCancel = message.type === MSG_TYPE.CANCEL
    return (
        <div className="failContent">
            <p>{ isError?'生成失败':isCancel?'已为您取消生成':'提示词包含敏感词'}</p>
            <p>
                { (isError || isCancel)?<span className='reStart' onClick={onReStart}>点击重新生成</span>:'请修改敏感词再生成'}
            </p>
        </div>
    )
}